package org.bringer.service.impl;

import java.util.Calendar;
import java.util.List;

import javax.jws.WebService;

import org.bringer.dao.AnnotationDao;
import org.bringer.dao.SearchException;
import org.bringer.model.Account;
import org.bringer.model.Annotation;
import org.bringer.model.User;
import org.bringer.service.AnnotationManager;
import org.bringer.service.AnnotationService;
import org.bringer.service.exceptions.AccountExistsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * Implementation of UserManager interface.
 *
 * 
 */
@Service("annotationManager")
@WebService(serviceName = "AnnotationService", endpointInterface = "org.bringer.service.AnnotationService")
public class AnnotationManagerImpl extends GenericManagerImpl<Annotation, Long> implements AnnotationManager, AnnotationService {
    
    private AnnotationDao annotationDao;
    @Autowired
	public void setAnnotationDao(AnnotationDao annotationDao) {
		// TODO Auto-generated method stub
    	  this.dao = annotationDao;
          this.annotationDao = annotationDao;
	}
	@Override
	public Annotation saveAnnotation(Annotation annotation) {
		// TODO Auto-generated method stub
		return annotationDao.save(annotation);
	}
	@Override
	public void removeAnnotation(String annotationId) {
		// TODO Auto-generated method stub
		annotationDao.remove(Long.parseLong(annotationId));
	}
	@Override
	public List<Annotation> getAnnotationByDescription(String description) {
		// TODO Auto-generated method stub
		return annotationDao.getAnnotationByDescription(description);
	}
	@Override
	public List<Annotation> getAnnotationsByAccount(String iban) {
		// TODO Auto-generated method stub
		return annotationDao.getAnnotationsByAccount(iban);
	}
	@Override
	public List<Annotation> getAnnotationsByAccountInDates(String iban,
			Calendar initialDate, Calendar endDate) {
		// TODO Auto-generated method stub
		return annotationDao.getAnnotationsByAccountInDates(iban, initialDate, endDate);
	}
	@Override
	public List<Annotation> getAnnotationsByAccountAboveX(String iban,
			Double amount) {
		// TODO Auto-generated method stub
		return annotationDao.getAnnotationsByAccountAboveX(iban, amount);
	}

   
   
}
